package com.sgq.vue.entity.resource;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: 83778
 * @date: 2023-12-19 17:20
 * @desc:
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("resource_city")
public class City implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "id", index = 0)
    private  Long  id;

    @ExcelProperty(value = "城市英文名称", index = 1)
    private  String  cityEn;

    @ExcelProperty(value = "城市中文名称", index = 2)
    private  String  cityZh;

    @ExcelProperty(value = "省份英文名称", index = 3)
    private  String  provinceEn;

    @ExcelProperty(value = "省份中文名称", index = 4)
    private  String  provinceZh;

    @ExcelProperty(value = "省会/市中心中文名称", index = 5)
    private  String  leaderEn;

    @ExcelProperty(value = "省会/市中心英文名称", index = 6)
    private  String  leaderZh;

    @ExcelProperty(value = "省会/市中心id", index = 7)
    private  Long  leaderCode;

    @ExcelProperty(value = "经度", index = 8)
    private  String  lat;

    @ExcelProperty(value = "维度", index = 9)
    private  String  lon;

    @ExcelIgnore
    @ApiModelProperty(value = "是否包含子节点")
    @TableField(exist = false)
    private boolean hasChildren;

    /**
     * 子城市
     */
    @ExcelIgnore
    @TableField(exist = false)
    @JsonInclude(JsonInclude.Include.NON_NULL) //属性值为null的不进行序列化
    private List<City> children = new ArrayList<>();

}
